server {
  listen 80;
  server_name www.ldz2.net;

  access_log  /data/nginx/logs/www.ldz2.net-access.log;
  error_log /data/nginx/logs/www.ldz2.net-error.log;

  location / {

    root  /data/nginx/html/pc;
    #index index.html;
  }

  location /about {

   root  /data/nginx/html/pc;
   index index.html;

   try_files $uri $uri/index.html $uri.html =489;
  }

  location ~* \.(gif|jpg|bmp|png|tiff|tif|ico|wmf|js)$ {
    root /data/nginx/images1;
    index index.html;
  }

  location ^~ /images {

    root  /data/nginx;
    index index.html;
  }

  #location /about {

  #  alias  /data/nginx/html/pc;
  #  index index.html;
  #}

   #location = /2.jpg {
   #  root /var/www/nginx/images/;
   #  index index.html;

   #}

   location = /login/ {
     root /data/nginx/html/pc;
     index index.html;
     auth_basic		"test";
     auth_basic_user_file /etc/nginx/.htpasswd;


   }

#   location /about {
#     alias /data/nginx/html/pc;
#     index index.html;
#     deny 192.168.68.146;
#     allow 192.168.100.192;
#     allow 10.1.1.0/16;
#     #deny all;
#    
#
#   }
#
   location  ~ /A.?\.jpg {
     index index.html;
     root /var/www/nginx/images/;

   }

   location /download {
     autoindex on;
     autoindex_exact_size on;
     
     autoindex_localtime  on;
     root /data/nginx/html/pc;
     #limit_rate 10k;


   }

   location /upload  {
     root /data/ldz/pc;
     index index.html;

     limit_except GET {


       allow 192.168.68.146;
       deny all;
     }
   }

   location /main {
     index index.html;
     default_type text/html;
     echo "hello world,main--->";
     echo_reset_timer;
     echo_location /sub1;
     echo_location /sub2;
     echo "took $echo_timer_elapsed sec for total.";


   }

   location /sub1 {
     echo_sleep 1;
     echo sub1;

   }
   
   location /sub2 {
     echo_sleep 1;
     echo sub2;

   }
   
   error_page 500 502 503 504 404 /error.html;
   
    location = /error.html {
        root   /usr/share/nginx/html;
    } 


 }
